import http from './http'

// 微信jssdk获取签名信息
const getSignPackage = (url) => {
    return http.get(
        'api/wechat/getSignPackage',
        {params:{url}}
    )
}

// 获取首页文章列表
const getIndexList = (page, limit) => {
    return http.post(
        'api/article/getIndexList',
        {page, limit}
    )
}

// 获取首页nav数据
const getNav = () => {
    return http.post(
        'api/nav/getNav'
    )
}
// code换取openid
const getUserInfo = (code) => {
    return http.get(
        'api/wechat/getUserInfo',
        {params:{code}}
    )
} 

// 获取首页公告
const getNewNotice = () => {
    return http.post(
        'api/notice/getNewNotice'
    )
}
// 授权登录
const authLogin = (url) => {
    return http.post(
        'api/wechat/authLogin',
        {url}
    )
}
export {
    getSignPackage,
    getIndexList,
    getNav,
    getNewNotice,
    getUserInfo,
    authLogin
}